package service;

import dao.UserDao;
import entity.User;
import org.springframework.beans.factory.annotation.Autowired;

public class UserServiceImpl {
    @Autowired
    UserDao userDao;



    public int register(User user) {

        User repeatUser = userDao.selectUserByUserName(user.getNumber());
        if (repeatUser != null){

            return 404;
        }
        int i = userDao.insertUser(user);

        if (i != 1){
            return 500;
        }
        return 405;
    }
}
